package com.zhima.util;

import com.zhima.exception.ZhimaOjException;

import static com.zhima.exception.ErrorCode.NOT_ALLOW_OPERATE_OTHER_RESOURCES;

/**
 * @author : 芝麻
 * @date : 2023-08-27 20:16
 **/
public class AuthorizationUtil {
    public static void isLoginUserResource(Long loginUserId, Long resourceOwnerId) {
        if (!loginUserId.equals(resourceOwnerId)) {
            throw new ZhimaOjException(NOT_ALLOW_OPERATE_OTHER_RESOURCES);
        }
    }
}
